/*
 * str_cli.c
 *
 *  Created on: Mar 30, 2012
 *      Author: root
 */

#include	"unp.h"

void
str_cli(FILE *fp, int sockfd)
{
	char	sendline[MAXLINE], recvline[MAXLINE];

	do {
		Fgets(sendline, MAXLINE, fp);

		Writen(sockfd, sendline, strlen(sendline));

		if (recv(sockfd, recvline, MAXLINE,0) == 0)
			err_quit("str_cli: server terminated prematurely");

		printf("%s", recvline);

	}while(strcmp(sendline,".\n")!=0);
	return;
}
